from asyncio.windows_events import NULL
from operator import length_hint


f = open("resource.txt", "a+")
f.seek(0)
old = f.readlines()

mid = []
new = ""
if(old == []):
    print("请在resource.txt里粘贴英语文章，并重新执行程序。")
else:
    # print(old)
    for x in old:
        mid += x.split(" ")

    for y in mid:
        if(y=="\n"):
            new += "\n"
        elif(len(y)==0):
            new += " "
        else:
            length = len(y)
            half = int(length/2)+1
            yy = list(y)
            yy.insert(0, "**")
            yy.insert(half, "**")
            new += " "+''.join(yy)

    new += "\n"

fw = open("result.md","w")
fw.write(new)

print("已经保存至result.md，请使用MarkDown阅读器打开。")